//
//  AllproductsViewCell.swift
//  NewLndd
//
//  Created by 邵禹曦 on 2020/1/3.
//  Copyright © 2020 辽宁当代. All rights reserved.
//

import UIKit
// MARK: - 全部商品
class AllproductsViewCell: UITableViewCell {
    
    // MARK: - 控件属性
    @IBOutlet weak var CON: UILabel!              // 商品名称
    
    @IBOutlet weak var purLowBP: UILabel!       // 买挂单最低报价
    @IBOutlet weak var purHighBP: UILabel!      // 买挂单最高报价
    @IBOutlet weak var purLowBQ: UILabel!       // 买挂单最低报价量
    @IBOutlet weak var purQ: UILabel!            // 买挂单，挂单量
    
    
    @IBOutlet weak var sellLowBP: UILabel!      // 卖挂单最低报价
    @IBOutlet weak var sellHighBP: UILabel!     // 卖挂单最高报价
    @IBOutlet weak var sellLowBQ: UILabel!      // 卖挂单最低报价量
    @IBOutlet weak var sellQ: UILabel!           // 卖挂单，挂单量

    // 买挂单按钮
    @IBOutlet weak var m3gdBtn: UIButton!
    // 卖挂单按钮
    @IBOutlet weak var m4gdBtn: UIButton!
    
    
    // MARK: - 自定义属性
    var ViewModel : Allproducts? {
        // 属性监听器
        didSet {
            
            // 1. nil值校验
            guard let ViewModel = ViewModel else {
                return
            }
            
            CON.text = ViewModel.CON
            purLowBP.text = ViewModel.purLowBP
            purHighBP.text = ViewModel.purHighBP
            purLowBQ.text = ViewModel.purLowBQ
            purQ.text = ViewModel.purQ
            
            sellLowBP.text = ViewModel.sellLowBP
            sellHighBP.text = ViewModel.sellHighBP
            sellLowBQ.text = ViewModel.sellLowBQ
            sellQ.text = ViewModel.sellQ
            
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

    }

}
